import { MidwayConfig } from '@midwayjs/core';
// import    one   from '../entity/**/*'
// console.log("entity1",one);
const path = require('path')
// import Photo  from '../entity/testa/photo'
console.log("路径",path.resolve(__dirname,"../entity/**/*"));
console.log("路径2",__dirname,"../entity/**/*");

export default  {
  // use for cookie sign key, should change to your own and keep security
  keys: '1666102449701_9837',
  koa: {
    port: 7001,
  },
  typeorm: {
    dataSource: {
      default: {
        type: 'mysql',
        host: '127.0.0.1',
        port: 3306,
        username: 'root',
        password: 'root123',
        database: 'xs',
        // 自动建表 注意：线上部署的时候不要使用，有可能导致数据丢失
        synchronize: true,
        // 打印日志
        logging: true,
        driver: require('mysql2'),
        // 字符集
        charset: 'utf8mb4',
        // 驱动
        // driver: require('mysql2'),
        // 设置时区
        // timezone: '+8:00',
          entities: '/entity',
        // entities: [Photo], 
      }
    }
  },
} as MidwayConfig;


